package lab02.test22;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        char tmp;

        Scanner sc = new Scanner(System.in);

        /*从键盘输入字符串,并创建一个与字符串等长的数组*/
        System.out.println("请输入一个字符串：");
        String string = sc.nextLine();
        char[] chars = new char[string.length()];

        /**
         * 大写->小写
         * 数字->0
         * 其他->#
         */

        for (int i = 0; i < string.length(); i++) {

            tmp = string.charAt(i);

            if (tmp >= 'A' && tmp <= 'Z') {

                chars[i] = (char) (tmp + 32);

            } else if (tmp >= '0' && tmp <= '9') {

                chars[i] = '0';

            } else if (tmp >= 'a' && tmp <= 'z') {

                chars[i] = string.charAt(i);
            } else {

                chars[i] = '#';
            }

        }

          /*输出结果*/
        for (int j = 0; j < chars.length; j++) {
            System.out.print(chars[j]);
        }


    }
}
